package cn.edu.hncj.aspect;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

import java.time.LocalDateTime;

/**
 * @author Mr.ma
 * @since 2022/11/13 22:09
 **/
public class AnnAdvice {
    @Pointcut("@annotation(org.springframework.web.bind.annotation.GetMapping)")
    private void logPointcut(){}

    @After("logPointcut()")
    public void before(){
        System.out.println("添加getTest的前置日志");
        LocalDateTime localDateTime = LocalDateTime.now();
        System.out.println(localDateTime + "    INFO    后置通知");
    }
}
